<?php
class Address_book_model extends MY_Model {

	var $company = null;
	var $firstname = null;
	var $lastname = null;
	var $address1 = null;
	var $address2 = null;
	var $city = null;
	var $postalcode = null;
	var $country = null;
	var $region = null;
	var $user_id = null;
	
	function __construct() {
		parent::__construct(); 
	}

	public function find_by_user($userid) {
		$sql = "SELECT * FROM " . $this->table() . " WHERE valid = ? AND user_id = ?";
		return $this->db->query($sql, array(1,$userid))->result_object();
	}
	
}
?>